package com.niguang.work.api.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableLogic;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 'work.v_personSite' is not BASE TABLE
 * </p>
 *
 * @author chenliu
 * @since 2018-07-23
 */
@TableName("work_machine")
@Data
public class Machine extends Model<Machine> {

    private static final long serialVersionUID = 1L;

    private Long id;
    /**
     * 工地id
     */
    private Long siteId;
    /**
     * mac地址
     */
    private String mac;
    /**
     * pad开门地址
     */
    private String padMacIn;
    /**
     * pad出门地址
     */
    private String padMacOut;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @TableLogic
    private Boolean delFlag;

    @TableField(exist = false)
    private String siteName;

    @TableField("mac_name")
    private String macName;


    public static final String ID = "id";

    public static final String SITE_ID = "site_id";

    public static final String MAC = "mac";

    public static final String PAD_MAC_IN = "pad_mac_in";

    public static final String PAD_MAC_OUT = "pad_mac_out";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String DEL_FLAG = "del_flag";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Machine{" +
                "id=" + id +
                ", siteId=" + siteId +
                ", mac=" + mac +
                ", padMacIn=" + padMacIn +
                ", padMacOut=" + padMacOut +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", delFlag=" + delFlag +
                "}";
    }
}
